home *** CD-ROM | disk | FTP | other *** search
/ C++ für Kids / C++ for kids.iso / SETUP / US / CBUILDER / DATA.Z / MSACM.H < prev    next >
C/C++ Source or Header  |  1997-02-13  |  59KB  |  1,899 lines

  1. //==========================================================================;
  2. //
  3. //  msacm.h
  4. //
  5. //  Copyright (c) 1992-1995 Microsoft Corporation.  All Rights Reserved.
  6. //
  7. //  Description:
  8. //      Audio Compression Manager Public Header File
  9. //
  10. //  History:
  11. //
  12. //==========================================================================;
  13.  
  14. #ifndef _INC_ACM
  15. #define _INC_ACM        /* #defined if msacm.h has been included */
  16. #pragma option -b
  17.  
  18. #if !defined(_INC_MMREG) || (_INC_MMREG < 142)
  19. #ifndef RC_INVOKED
  20. #error MMREG.H version 142 or greater to be included first
  21. #endif
  22. #endif
  23.  
  24. #if defined(WIN32) && !defined(_WIN32)
  25. #ifndef RC_INVOKED
  26. #pragma message("MSACM.H: defining _WIN32 because application defined WIN32")
  27. #endif
  28. #define _WIN32
  29. #endif
  30.  
  31. #if defined(UNICODE) && !defined(_UNICODE)
  32. #ifndef RC_INVOKED
  33. #pragma message("MSACM.H: defining _UNICODE because application defined UNICODE")
  34. #endif
  35. #define _UNICODE
  36. #endif
  37.  
  38. #ifdef __BORLANDC__
  39. #pragma option -b.
  40.   #include <pshpack1.h>
  41. #pragma option -b
  42. #endif
  43.  
  44. #ifdef __cplusplus
  45. extern "C" {            /* Assume C declarations for C++ */
  46. #endif  /* __cplusplus */
  47.  
  48. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  49. //
  50. //
  51. //
  52. //
  53. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  54.  
  55. #ifndef DRV_MAPPER_PREFERRED_INPUT_GET
  56. #define DRV_MAPPER_PREFERRED_INPUT_GET  (DRV_USER + 0)
  57. #endif
  58.  
  59. #ifndef DRV_MAPPER_PREFERRED_OUTPUT_GET
  60. #define DRV_MAPPER_PREFERRED_OUTPUT_GET (DRV_USER + 2)
  61. #endif
  62.  
  63. #ifndef DRVM_MAPPER_STATUS
  64. #define DRVM_MAPPER_STATUS              (0x2000)
  65. #endif
  66.  
  67. #ifndef WIDM_MAPPER_STATUS
  68. #define WIDM_MAPPER_STATUS              (DRVM_MAPPER_STATUS + 0)
  69. #define WAVEIN_MAPPER_STATUS_DEVICE     0
  70. #define WAVEIN_MAPPER_STATUS_MAPPED     1
  71. #define WAVEIN_MAPPER_STATUS_FORMAT     2
  72. #endif
  73.  
  74. #ifndef WODM_MAPPER_STATUS
  75. #define WODM_MAPPER_STATUS              (DRVM_MAPPER_STATUS + 0)
  76. #define WAVEOUT_MAPPER_STATUS_DEVICE    0
  77. #define WAVEOUT_MAPPER_STATUS_MAPPED    1
  78. #define WAVEOUT_MAPPER_STATUS_FORMAT    2
  79. #endif
  80.  
  81. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  82. //
  83. //
  84. //
  85. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  86.  
  87. #ifdef _WIN32
  88.     #define ACMAPI              WINAPI
  89. #else
  90. #if defined(_WINDLL) || defined(__DLL__)
  91.     #define ACMAPI              _far _pascal _loadds
  92. #else
  93.     #define ACMAPI              _far _pascal
  94. #endif
  95. #endif
  96.  
  97. //--------------------------------------------------------------------------;
  98. //
  99. //  ACM General API's and Defines
  100. //
  101. //
  102. //
  103. //
  104. //--------------------------------------------------------------------------;
  105.  
  106. //
  107. //  there are four types of 'handles' used by the ACM. the first three
  108. //  are unique types that define specific objects:
  109. //
  110. //  HACMDRIVERID: used to _identify_ an ACM driver. this identifier can be
  111. //  used to _open_ the driver for querying details, etc about the driver.
  112. //
  113. //  HACMDRIVER: used to manage a driver (codec, filter, etc). this handle
  114. //  is much like a handle to other media drivers--you use it to send
  115. //  messages to the converter, query for capabilities, etc.
  116. //
  117. //  HACMSTREAM: used to manage a 'stream' (conversion channel) with the
  118. //  ACM. you use a stream handle to convert data from one format/type
  119. //  to another--much like dealing with a file handle.
  120. //
  121. //
  122. //  the fourth handle type is a generic type used on ACM functions that
  123. //  can accept two or more of the above handle types (for example the
  124. //  acmMetrics and acmDriverID functions).
  125. //
  126. //  HACMOBJ: used to identify ACM objects. this handle is used on functions
  127. //  that can accept two or more ACM handle types.
  128. //
  129. DECLARE_HANDLE(HACMDRIVERID);
  130. typedef HACMDRIVERID       *PHACMDRIVERID;
  131. typedef HACMDRIVERID   FAR *LPHACMDRIVERID;
  132.  
  133. DECLARE_HANDLE(HACMDRIVER);
  134. typedef HACMDRIVER         *PHACMDRIVER;
  135. typedef HACMDRIVER     FAR *LPHACMDRIVER;
  136.  
  137. DECLARE_HANDLE(HACMSTREAM);
  138. typedef HACMSTREAM         *PHACMSTREAM;
  139. typedef HACMSTREAM     FAR *LPHACMSTREAM;
  140.  
  141. DECLARE_HANDLE(HACMOBJ);
  142. typedef HACMOBJ            *PHACMOBJ;
  143. typedef HACMOBJ        FAR *LPHACMOBJ;
  144.  
  145. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  146. //
  147. //  ACM Error Codes
  148. //
  149. //  Note that these error codes are specific errors that apply to the ACM
  150. //  directly--general errors are defined as MMSYSERR_*.
  151. //
  152. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  153.  
  154. #ifndef _MMRESULT_
  155. #define _MMRESULT_
  156. typedef UINT                MMRESULT;
  157. #endif
  158.  
  159. #define ACMERR_BASE         (512)
  160. #define ACMERR_NOTPOSSIBLE  (ACMERR_BASE + 0)
  161. #define ACMERR_BUSY         (ACMERR_BASE + 1)
  162. #define ACMERR_UNPREPARED   (ACMERR_BASE + 2)
  163. #define ACMERR_CANCELED     (ACMERR_BASE + 3)
  164.  
  165. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  166. //
  167. //  ACM Window Messages
  168. //
  169. //  These window messages are sent by the ACM or ACM drivers to notify
  170. //  applications of events.
  171. //
  172. //  Note that these window message numbers will also be defined in
  173. //  mmsystem.
  174. //
  175. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  176.  
  177. #define MM_ACM_OPEN         (MM_STREAM_OPEN)  // conversion callback messages
  178. #define MM_ACM_CLOSE        (MM_STREAM_CLOSE)
  179. #define MM_ACM_DONE         (MM_STREAM_DONE)
  180.  
  181. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  182. //
  183. //  acmGetVersion()
  184. //
  185. //  the ACM version is a 32 bit number that is broken into three parts as 
  186. //  follows:
  187. //
  188. //      bits 24 - 31:   8 bit _major_ version number
  189. //      bits 16 - 23:   8 bit _minor_ version number
  190. //      bits  0 - 15:   16 bit build number
  191. //
  192. //  this is then displayed as follows:
  193. //
  194. //      bMajor = (BYTE)(dwVersion >> 24)
  195. //      bMinor = (BYTE)(dwVersion >> 16) & 
  196. //      wBuild = LOWORD(dwVersion)
  197. //
  198. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  199.  
  200. DWORD ACMAPI acmGetVersion
  201. (
  202.     void
  203. );
  204.  
  205. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  206. //
  207. //  acmMetrics()
  208. //
  209. //
  210. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  211.  
  212. MMRESULT ACMAPI acmMetrics
  213. (
  214.     HACMOBJ                 hao,
  215.     UINT                    uMetric,
  216.     LPVOID                  pMetric
  217. );
  218.  
  219. #define ACM_METRIC_COUNT_DRIVERS            1
  220. #define ACM_METRIC_COUNT_CODECS             2
  221. #define ACM_METRIC_COUNT_CONVERTERS         3
  222. #define ACM_METRIC_COUNT_FILTERS            4
  223. #define ACM_METRIC_COUNT_DISABLED           5
  224. #define ACM_METRIC_COUNT_HARDWARE           6
  225. #define ACM_METRIC_COUNT_LOCAL_DRIVERS      20
  226. #define ACM_METRIC_COUNT_LOCAL_CODECS       21
  227. #define ACM_METRIC_COUNT_LOCAL_CONVERTERS   22
  228. #define ACM_METRIC_COUNT_LOCAL_FILTERS      23
  229. #define ACM_METRIC_COUNT_LOCAL_DISABLED     24
  230. #define ACM_METRIC_HARDWARE_WAVE_INPUT      30
  231. #define ACM_METRIC_HARDWARE_WAVE_OUTPUT     31
  232. #define ACM_METRIC_MAX_SIZE_FORMAT          50
  233. #define ACM_METRIC_MAX_SIZE_FILTER          51
  234. #define ACM_METRIC_DRIVER_SUPPORT           100
  235. #define ACM_METRIC_DRIVER_PRIORITY          101
  236.  
  237. //--------------------------------------------------------------------------;
  238. //
  239. //  ACM Drivers
  240. //
  241. //
  242. //
  243. //
  244. //--------------------------------------------------------------------------;
  245.  
  246. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  247. //
  248. //  acmDriverEnum()
  249. //
  250. //
  251. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  252.  
  253. typedef BOOL (CALLBACK *ACMDRIVERENUMCB)
  254. (
  255.     HACMDRIVERID            hadid,
  256.     DWORD                   dwInstance,
  257.     DWORD                   fdwSupport
  258. );
  259.  
  260. MMRESULT ACMAPI acmDriverEnum
  261. (
  262.     ACMDRIVERENUMCB         fnCallback,
  263.     DWORD                   dwInstance,
  264.     DWORD                   fdwEnum
  265. );
  266.  
  267. #define ACM_DRIVERENUMF_NOLOCAL     0x40000000L
  268. #define ACM_DRIVERENUMF_DISABLED    0x80000000L
  269.  
  270. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  271. //
  272. //  acmDriverID()
  273. //
  274. //
  275. //- - - - - - - - - - - - - - - - - - - - -